function initMenu() {
  $('#menu ul').hide();
  $('#menu ul:first').show();
  $('#menu li a').click(
    function() {
      var checkElement = $(this).next();
      if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
        return false;
        }
      if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
        $('#menu ul:visible').slideUp('normal');
        checkElement.slideDown('normal');
        return false;
        }
      }
    );
  }

$(function (){
	$('#topMenu > div').each(
     function(i)
	 {
		$(this).click(function(){
			if(!$(this).hasClass('menuShow'))
			{
				$('.menuShow').removeClass("menuShow").toggleClass('menuHidden');
				$(this).removeClass("menuHidden").addClass('menuShow title');
			}
		})
	 });
})

function initTopMenu()
{
    var CurrentPage = $("#ctl00_hiddenPageName").attr("value");
    var CurrentShow = $(".menuShow")[0];
    switch(CurrentPage)
    {
//        case "CP":
//            CurrentShow.className="menuHidden";
//            $("#divControl").attr("class","menuShow");
//            break;
        case "DM":
           
            CurrentShow.className="menuHidden";
             $("#ctl00_divManagement").attr("class","menuShow");
            break;
        case "AS":
           
            CurrentShow.className="menuHidden"; 
            $("#ctl00_divAccreditation").attr("class","menuShow");
            break;
          case "RP":
            CurrentShow.className="menuHidden"; 
            $("#ctl00_divReoprts").attr("class","menuShow");
            break;
        case "IS":
            
            CurrentShow.className="menuHidden";
            $("#ctl00_divInformation").attr("class","menuShow");
            break;
        case "TS":
            
            CurrentShow.className="menuHidden";
            $("#ctl00_divTest").attr("class","menuShow");
            break;
        case "SM":
            CurrentShow.className="menuHidden";
            $("#ctl00_divSystem").attr("class","menuShow");
            break;
        case "IV":
            CurrentShow.className = "menuHidden";
            $("#ctl00_divInterview").attr("class", "menuShow");
            break;
        default:
            break;
    }
}

$(document).ready(function() {initMenu();initTopMenu()});